<template>
  <div class="header">
    <h1>
        我是Header
    </h1>
    <p>count的值是{{count}}</p>
    <p>价格是{{price}}</p>
  </div>
</template>

<script>
import { mapState } from 'vuex';
export default {
name:'Header',
mounted(){
    console.log(this);
},
computed:{
    ...mapState(['count','price'])
}
}
</script>

<style scoped>
.header {
  margin: 30px;
  background: yellowgreen;
}
</style>